package com.zzxy.mvc12.controller;

import com.zzxy.mvc12.po.Student;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/stu")
public class StruController {
    @RequestMapping("/register")
    public @ResponseBody  Student register(@RequestBody Student student) {
        System.out.println(student);
        student.setUsername(student.getUsername() + "12");
        student.setPassword(student.getPassword()+"12");
        return student;
    }

    @RequestMapping("/add")
    public String add() {
        return "/user/register";
    }
}
